/**
 * Created by wangzilong on 2017/4/11.
 */
import React, { Component } from 'react';
import {
    StyleSheet,
    Text,
    View,
    Modal,
    Platform,
    ActivityIndicator
} from 'react-native';
import ImageWrapper from './ImageWrapper';
var Dimensions = require('Dimensions');
const { width, height } = Dimensions.get('window');

export default class LoadingModal extends Component{

    render(){
        var visible = this.props.visible;
        return (
            
                <Modal
                    animationType={"fade"}
                    transparent={true}
                    visible={visible}
                    onRequestClose={this.props.onRequestClose}>
                    <View style={[styles.container,this.props.style]}>
                        <ActivityIndicator
                            animating={visible}
                            style={styles.loadBox}
                            size="large" />
                    </View>
                </Modal>
        )

    }

}


const styles = StyleSheet.create({
    container:{
        flex:1,
        backgroundColor:'rgba(3,3,3,.5)',
        justifyContent:'center',
        alignItems:'center',
        ...Platform.select({
            ios: {
                marginTop: 20
            },
            android: {
                marginTop:0
            },

        }),
    },
    loadBox:{
        height: 80,
        width:120,
        borderRadius:5,
        backgroundColor:'rgba(3,3,3,0.7)',
    }
    
});